package com.weight.common.generate.base;


public enum FieldTypeEnum{  
	FIELD_TYPE_TIMESTAMP("TIMESTAMP","Date"),
	FIELD_TYPE_DATE("DATE","Date"),
	FIELD_TYPE_DECIMAL("DECIMAL","BigDecimal"),
	FIELD_TYPE_TINYINT("TINYINT","Integer"),
	FIELD_TYPE_VARCHAR("VARCHAR","String")
	;
	private String doType;  //数据库类型
	private String poType;	//实体类类型
	
	private FieldTypeEnum(String doType, String poType) {
		this.doType = doType;
		this.poType = poType;
	}
	public static FieldTypeEnum fromResultEnum(String doType) {  
        for (FieldTypeEnum fieldTypeEnum : FieldTypeEnum.values()) {  
            if (fieldTypeEnum.getDoType().equals(doType)) {  
                return fieldTypeEnum;  
            }  
        }  
        return null;  
    }
	public static String fromResultEnumPo(String doType) {  
        for (FieldTypeEnum fieldTypeEnum : FieldTypeEnum.values()) {  
            if (fieldTypeEnum.getDoType().equals(doType)) {  
                return fieldTypeEnum.getPoType();  
            }  
        }  
        return null;  
    }
	public String getDoType() {
		return doType;
	}
	public void setDoType(String doType) {
		this.doType = doType;
	}
	public String getPoType() {
		return poType;
	}
	public void setPoType(String poType) {
		this.poType = poType;
	}
}
